<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div><span id="mi">小米5</span><button id="btn">删除</button></div>
    
    <script>
        var mi = document.getElementById("mi");
        var btn = document.getElementById("btn");
        btn.onclick = function(){
            var result = window.confirm("你确定删除吗");
            if(result){
                // mi.parentNode.removeChild(mi);
                // 或者
                mi.style.display="none";
            }
        }
    </script>
</body>
</html>